package cn.amebius.simpledocker.entity.dto;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * UserBaseInfo的Dto数据类
 * @author 阿伟
 * @date 2023/7/28 15:50
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class UserBaseInfoDto {

    private Integer id;

    private String name;

    private String email;

    private String mobile;

    private Date createTime;

    public static void check(UserBaseInfoDto ubid) {
        if (ubid == null || ubid.id.toString().isEmpty() || ubid.name.isEmpty() || ubid.email.isEmpty() || ubid.mobile.isEmpty() || ubid.createTime.toString().isEmpty()) {
            throw new DataErrorException("数据异常:用户基本信息丢失");
        }
    }

}
